<html>
<body>
	<?php
		$phone = $password = $nickname = $code= "";
		// 关联数组
		$citiesArray = array("广州" => "010","上海" => "020", "北京" => "030",
					"南京" => "040", "武汉" => "050", "重庆" => "060");
		if ($_SERVER["REQUEST_METHOD"] == "POST") {
			echo "<div align='center'>";
				echo "你的手机号：";
				echo $_POST["phone"];
				echo "<br />";
				echo "创建密码：";
				echo $_POST["password"];
				echo "<br />";
				echo "昵称：";
				echo $_POST["nickname"];
				echo "<br />";
				echo "性别：";
				echo $_POST["sex"];
				echo "<br />";
				echo "所在地：";
				echo $_POST["cities"];
				echo "<br />";
				echo "所在区号：";
				echo $citiesArray[$_POST["cities"]];
				echo "<br />";
				echo "手机验证码：";
				echo $_POST["code"];
				echo "<br />";
			echo "</div>";
			// $phone = test_input($_POST["phone"]);
		   // $password = test_input($_POST["password"]);
		   // $nickname = test_input($_POST["nickname"]);
		   // $sex = test_input($_POST["sex"]);
		   // $city = test_input($citiesArray[$_POST["cities"]]);
		   // $code = test_input($_POST["code"]);
		}

		// function test_input($data) {
		//    $data = trim($data);
		//    $data = stripslashes($data);
		//    $data = htmlspecialchars($data);
		//    echo $data;
		//    echo "<br />";
		// }
	?>
</body>
</html>